package com.erp.remote.information;

import com.erp.entity.information.Area;
import com.erp.util.AjaxResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@RequestMapping("/information/area")
public interface AreaRemote {

    @RequestMapping("/allArea")
    AjaxResult allArea();

    @RequestMapping("/selectAreaByCompanyId")
    AjaxResult selectAreaByCompanyId(@RequestParam("companyId") Integer companyId);


    @RequestMapping("/selectAreaByCompanyIdPage")
    AjaxResult selectAreaByCompanyIdPage(@RequestBody Map<String, Object> params);

    /**
     * 根据地区的编码查询数据，含companyId
     * @param params
     * @return
     */
    @RequestMapping("/getAreaByDescription")
    AjaxResult getAreaByDescription(@RequestBody Map<String,Object> params);

    @RequestMapping("/addArea")
    AjaxResult addArea(@RequestBody Area area);

    /**
     * 用于在新增时，根据areaCode验证地区编码是否唯一
     * @param areaCode
     * @return
     */
    @RequestMapping("/checkAreaOnly")
    AjaxResult checkAreaOnly(@RequestParam("areaCode") String areaCode);

    @RequestMapping("/updateArea")
    AjaxResult updateArea(@RequestBody Area area);



    /**
     * 启用地区
     * @param params
     * @return
     */
    @PostMapping("/enableArea")
    AjaxResult enableArea(@RequestBody Map<String,Object> params);

    /**
     * 禁用地区
     * @param params
     * @return
     */
    @PostMapping("/disableArea")
    AjaxResult disableArea(@RequestBody Map<String,Object> params);





}
